1. Field of the Invention
The present invention relates to an image processing apparatus, and a method and a storage medium for controlling the same. More specifically, the present invention relates to an image processing technique for correcting misregistration.
2. Description of the Related Art
In color printers as color image forming apparatuses, multiple printing mechanisms configured to print different colors are arranged next to each other, and perform printing by using cyan, magenta, yellow, and black toners. This type of color printer puts images of the four toners on a recording medium one color after another. Thus, misregistration is likely to occur. Usually, misregistration of a printer occurs lengthways or sideways on the recording medium. It is difficult to completely eliminate misregistration because there are various factors that cause misregistration such as errors in the attached positions of lasers, variations in the conveyance speed of the recording medium, and unevenness in rotations of rotary bodies due to their eccentricity. For this reason, image processing called a trapping process is usually performed to correct misregistration.
Trapping is a technique that prevents a white space resulting from misregistration, by slightly expanding any one or both of colors sitting next to each other so that these colors may be printed to partly overlap one another. The method in Japanese Patent Laid-Open No. 2008-141623 is one technique related to the trapping process. In this method, a trap color is created for each target pixel by using peripheral pixels of the target pixel (hereinafter, referred to as the reference regions). The trap color refers to data on a process color to be used in the trapping of a target pixel at which a white space is formed due to misregistration. In other words, the trap color refers to data on a process color to be expanded.
In Japanese Patent Laid-Open No. 2008-141623, it is determined whether or not there is any pixel to be excluded from the reference regions. In this process, any white pixel or any whiteish light pixel (any pixel with a low density) is determined as an unnecessary pixel and excluded from the reference regions. This is because even if misregistration occurs, the resultant white space would not be noticeable and no trapping is therefore performed in a case where the density is low (light). This determination is done by comparing the density of the reference pixel and a given threshold.
However, some images may include many pixels around the threshold, or other some images may be gradation images. In such cases, the ON/OFF of trapping may be switched, thereby possibly causing degradation of the image.
Now, this problem will be described with reference to FIGS. 7A, 7B, 7C, 8A, 8B, and 8C. FIG. 7A is an input image, in which a letter part 701 is in yellow (Y) with a constant density value, and a background part 702 is in cyan (C) with varying density values due to a given background pattern. FIG. 7B is an output result obtained by processing the input image by controlling the ON/OFF of trapping based on a threshold as in the case of the conventional method. In a case where the background 702 has varying density values, particularly, in a case where the density values are varying within a range around the threshold, the ON/OFF of the trapping process is switched. Black squares and rectangles 703 in FIG. 7B are pixels on which a trapping process is performed according to the conventional method. In this example, the cyan (C) of the background part 702 is expanded to part of the yellow (Y) of the letter part. That is, printing is performed based on image data to which cyan (C) pixels are added. Due to the variations in the density value of the background part, the ON/OFF of the trapping process is switched in the letter part 701. Thus, in the output result, the edge of the letter part 701 is not smooth. FIG. 7C is an example of the ideal processing result. Black squares and rectangles 704 are pixels on which a trapping process is performed. It can be seen that the black squares and rectangles 704 are continuously connected at the edge of the letter part 701.
FIGS. 8A, 8B, and 8C are schematically enlarged views of regions 710, 720, and 730 in FIGS. 7A, 7B, and 7C, respectively. With the pixel at the upper left corner as a reference, the pixel in the fourth column from the left and the fifth row from the top will be denoted as P(4, 5). The other pixels will be denoted in a similar way.
A case under the following conditions, for example, will be described. The trap color (i.e. the process color to be expanded) is assumed to be set to cyan (C) of the background part by the user. Moreover, the threshold of the trap color (i.e. cyan) is assumed to be set to 50 by the user as a condition for the ON/OFF of trapping. As shown in FIG. 8A, the density value of cyan (C) in a pixel P(3, 4) is 53, the density value of cyan (C) in a pixel P(3, 5) is 48, and the density value of cyan in a pixel P(3, 6) is 51. The density of cyan (C) in all the pixels in the fifth to the ninth columns from the left is 0, and the density of yellow (Y) therein is 100. Likewise, the density of cyan (C) in the pixels from P(4, 1) to P(4, 6) and the pixels from P(3, 1) to P(3, 3) is 0, and the density of yellow (Y) therein is 100. The reference regions are the four pixels on the upper, right, lower, and left sides of the target pixel.
In a case where the pixel P(4, 5) is the target pixel, the reference regions are a pixel P(4, 4), the pixel P(3, 5), a pixel P(5, 5), and the pixel P(4, 6). Since there is no pixel with a density of cyan (C) above the threshold of 50, no trapping process is performed on the target pixel P(4, 5).
Next, in a case where the pixel P(4, 6) is the target pixel, the reference regions are the pixel P(4, 5), the pixel P(3, 6), a pixel P(5, 6), and a pixel P(4, 7). The density of cyan (C) in the pixel P(3, 6) is 51 and is above the threshold of 50. Thus, trapping is ON. By performing a trapping process in this manner, a result as shown in FIG. 8B is obtained. FIG. 8B is an output result obtained by performing a trapping process according to the conventional method. No trapping process is done on the pixel P(4, 5) and a pixel P(5, 8) in FIG. 8B, so that the ON/OFF of the trapping is switched. Consequently, their densities become different from those of other peripheral pixels. The density differences are noticeable, thereby making edge portions unnatural. The above example shows that the ON/OFF of a trapping process is switched, thereby causing an image defect, in a case where trapping is performed on an image having densities around a threshold according to the conventional method. FIG. 8C is an example of the ideal trapping process result and shows that the edge in the image is smoothly connected.